package ciicos.equ.service.impl;

import ciicos.equ.entity.EquPointEntity;
import ciicos.equ.mapper.EquPointMapper;
import ciicos.equ.model.equbase.EquBasePagination;
import ciicos.equ.service.EquPointService;
import ciicos.permission.service.AuthorizeService;
import ciicos.util.GeneraterSwapUtil;
import ciicos.util.ServletUtil;
import ciicos.util.UserProvider;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 设备信息
 * 版本： V3.2.0
 * 版权：
 * 作者： 企业研发中心
 * 日期： 2024-02-06
 */
@Service
public class EquPointServiceImpl extends ServiceImpl<EquPointMapper, EquPointEntity> implements EquPointService {


    @Autowired
    private GeneraterSwapUtil generaterSwapUtil;

    @Autowired
    private UserProvider userProvider;

    @Autowired
    private AuthorizeService authorizeService;

    @Override
    public QueryWrapper<EquPointEntity> getChild(EquBasePagination pagination, QueryWrapper<EquPointEntity> equPointQueryWrapper) {
        boolean pcPermission = false;
        boolean appPermission = false;
        boolean isPc = ServletUtil.getHeader("ciicos-origin").equals("pc");
        if (isPc) {
        }

        return equPointQueryWrapper;
    }


    @Override
    public List<EquPointEntity> getListByCdoe(String equId, String code) {
        QueryWrapper<EquPointEntity> queryWrapper = new QueryWrapper<>();
        queryWrapper.lambda().eq(EquPointEntity::getEquid, equId);
        queryWrapper.lambda().eq(EquPointEntity::getCode, code);
        return this.list(queryWrapper);
    }

}
